import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * This class is the controller for status
 * @author Sravya
 *
 */
public class StatusController 
{
	private StatusView sv;
	private StatusModel sm;
	private boolean isUserDone;
	/**
	 * This is the constructor for the StatusController
	 * @param sv
	 * @param sm
	 */
	public StatusController(StatusView sv, StatusModel sm)
	{
		this.sv = sv;
		this.sm = sm;
		isUserDone = false;
		
		sv.addOKListener(new OKListener());
	}
	/**
	 * This is the boolean if the user is done or not
	 * @return
	 */
	public boolean isUserDone()
	{
		return isUserDone;
	}
	/**
	 * This is the setter for whether the user is done or not
	 * @param isUserDone
	 */
	public void setWhetherUserIsDone(boolean isUserDone)
	{
		this.isUserDone = isUserDone;
	}
	/**
	 * This is the actionListener for the OK button
	 * @author Sravya
	 *
	 */
	private class OKListener implements ActionListener
	{
	
		public void actionPerformed(ActionEvent e) 
		{
			sm.setPace(sv.getPaceIndex());
			sm.setRation(sv.getRationIndex());
			isUserDone = true;
			sv.setVisible(false);
		}

		
	}
}
